#pragma once
#include "DXAMLCommon.h"
#include "IValueStore.h"


typedef void ( *TraverseCallback)(CXString *, void *, void *);

class CNode;


class CValueStore :
	public IValueStore
{
public: 
	CValueStore(XBOOL bObjectBase);
	~CValueStore();
	virtual XUINT32 Release();
	virtual void putIgnoreCase(XBOOL fIgnoreCase);
	void putAlwaysCallback(XBOOL fAlwaysCallback);
	virtual HRESULT PutValue(const CXString * pstrName, void * hValue);
	virtual HRESULT PutValue(XUINT32 cName, const XCHAR * pName, void * hValue);
	virtual HRESULT GetValue(const CXString * pstrName, void * * phValue);
	virtual HRESULT GetValue(XUINT32 cName, const XCHAR * pName, void * * phValue);
	virtual HRESULT Optimize();
	virtual HRESULT SetCleanupNotifier(PFNCleanupNotifier pCallBack);

	HRESULT Traverse(TraverseCallback pCallback, void * pExtraData);
	XUINT32 m_cRef;
	CNode * m_pTrie;
	XBOOL m_bIgnore;
	XBOOL m_bObjectBase;
	XBOOL m_isInCleanupState;
	PFNCleanupNotifier   m_pCleanupCallback;
	XBOOL m_bAlwaysCallback;
};

